package com.example.administrator.capital.presenter;
import com.example.administrator.capital.model.MineModel;
import com.example.administrator.capital.model.base.IActionRequest;
import com.example.administrator.capital.presenter.base.BasePresenter;
import com.example.administrator.capital.presenter.base.IViewBase;
import com.example.administrator.capital.presenter.base.IViewRequest;
import com.lzy.okgo.model.Response;
/**
 * Created by Administrator on 2017/12/22 0022.
 */
public class MinePresenter extends BasePresenter {
    private MineModel mMineModel;
    public MinePresenter(IViewBase iViewBase) {
        super(iViewBase);
        mMineModel = new MineModel();
    }
    /**
     * @param iViewRequest
     * @param username
     * 查询个人账户接口
     */
    public void oneMem(final IViewRequest<String> iViewRequest, String username){
        mMineModel.oneMem(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },username);
    }
    /**
     * @param iViewRequest
     * @param tel
     * @param paypass
     * @param Password
     * 修改个人账户接口
     */
    public void updateMem(final IViewRequest<String> iViewRequest, String tel,
                          String paypass, String Password){
        mMineModel.updateMem(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },tel,paypass,Password);
    }
    /**
     * @param iViewRequest
     * @param uid
     * 查询用户消息接口
     */
    public void selectMes(final IViewRequest<String> iViewRequest, String uid){
        mMineModel.selectMes(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }
            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }
            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }
            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid);
    }
    /**
     * @param iViewRequest
     * @param uid
     * 查询投资记录接口
     */
    public void investMent(final IViewRequest<String> iViewRequest, String uid ,int page,String status){
        mMineModel.investMent(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }
            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }
            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }
            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid,page,status);
    }
    /**
     * @param iViewRequest
     * @param uid
     * 查询我的账户接口
     */
    public void account(final IViewRequest<String> iViewRequest, String uid){
        mMineModel.account(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid);
    }
    /**
     * @param iViewRequest
     * @param uid
     * 查询资金明细接口
     */
    public void capital(final IViewRequest<String> iViewRequest, String uid){
        mMineModel.capital(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid);
    }
    /**
     * @param iViewRequest
     * @param uid
     * 跳转提现页面接口
     */
    public void withdrawals(final IViewRequest<String> iViewRequest, String uid){
        mMineModel.withdrawals(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid);
    }

    /**
     * @param iViewRequest
     * @param uid
     * 申请提现接口
     */
    public void applywithdrawals(final IViewRequest<String> iViewRequest, String uid,String Cash,String bankselect,String paypass){
        mMineModel.applywithdrawals(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid,Cash,bankselect,paypass);
    }

    /**
     * @param iViewRequest
     * @param uid
     * @param bankname
     * @param Openname
     * @param Bankaccount
     * @param Accountname
     * @param Bankcity
     * @param Idnumber
     * 银行卡确认添加接口
     */
    public void addbankcarduser(final IViewRequest<String> iViewRequest,
                                String uid,String bankname,
                                String Openname,String Bankaccount,String Accountname,String Bankcity,String Idnumber,String Updatetime){
        mMineModel.addbankcarduser(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid,bankname,Openname,Bankaccount,Accountname,Bankcity,Idnumber);
    }
    /**
     * 修改个人资料接口
     */
    public void updatemean(final IViewRequest<String> iViewRequest, String uid,String Username,
                           String Age){
        mMineModel.updatemean(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },uid,Username,Age);
    }
    public void updatepassword(final IViewRequest<String> iViewRequest, String oldpass,String password
                          ){
        mMineModel.updatepassword(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },oldpass,password);
    }
    public void updatapayword(final IViewRequest<String> iViewRequest, String yzm,String paypass,String tel
                          ){
        mMineModel.updatepayword(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        },yzm,paypass,tel);
    }

    public void banklist(final IViewRequest<String> iViewRequest){
        mMineModel.banklist(new IActionRequest<String>() {
            @Override
            public void success(Response<String> data) {
                iViewRequest.onSuccess(data);
            }

            @Override
            public void fail(Response<String> error) {
                iViewRequest.onFail(error);
            }

            @Override
            public void failMsg(String var) {
                iViewRequest.onFailMsg(var);
            }

            @Override
            public void code(int code) {
                iViewRequest.onCode(code);
            }
        });
    }
}
